package org.aviran.cookiebar2;

import org.aviran.cookiebar2.Util.StringUtil;

import org.junit.Assert;
import org.junit.Test;

/**
 * StringUtilTestCase
 *
 * @since : 2021.5.24
 */
public class StringUtilTestCase {
    /**
     * test String Is Contain Number
     */
    @Test
    public void testStringIsContainNumber () {
        String string = "This is an icon1";
        StringUtil stringUtil = new StringUtil();
        boolean result = stringUtil.stringIsContainNumber(string);
        Assert.assertNotNull(result);
        Assert.assertEquals(result, true);
    }

    /**
     * test String Is Not Contain Number
     */
    @Test
    public void testStringIsNotContainNumber () {
        String string = "This is an icon";
        StringUtil stringUtil = new StringUtil();
        boolean result = stringUtil.stringIsContainNumber(string);
        Assert.assertNotNull(result);
        Assert.assertEquals(result, false);
    }

    /**
     * test String No Number Increase
     */
    @Test
    public void testStringNoNumberIncrease () {
        String string = "This is an icon";
        StringUtil stringUtil = new StringUtil();
        String result = stringUtil.stringNumberIncrease(string);
        Assert.assertNotNull(result);
        Assert.assertEquals(result, "");
    }

    /**
     * test String Number Increase
     */
    @Test
    public void testStringNumberIncrease () {
        String string = "This is an icon1";
        StringUtil stringUtil = new StringUtil();
        String result = stringUtil.stringNumberIncrease(string);
        Assert.assertNotNull(result);
        Assert.assertEquals(result, "This is an icon2");
    }
}
